CC = gcc
CFLAGS = -W -Wall -pedantic
LFLAGS =
EXE = lang

all: main.o tokenizer.o list.o syntax.o
	$(CC) -o $(EXE) $^ $(CFLAGS) $(LFLAGS)

main.o: main.c
	$(CC) -c $^ $(CFLAGS)

tokenizer.o: tokenizer.c
	$(CC) -c $^ $(CFLAGS)

list.o: list.c
	$(CC) -c $^ $(CFLAGS)

syntax.o: syntax.c
	$(CC) -c $^ $(CFLAGS)

clean:
	-rm -rf $(EXE) *.o

